﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace BestCode.Creds.View.Utils
{
    public class AppSettingConfig
    {
        public string AnverseCredentialPath { get; set; }
        public string ReverseCredentialPath { get; set; }

        public string DefaultPicturesFolder { get; set; }
        public string DefaultOutputFolder { get; set; }

        public string DefaultPrinterName { get; set; }
    }


    public class ConfigReader
    {
        private static ConfigReader instance = null;

        public static ConfigReader Current 
        {
            get
            {
                if (instance == null)
                    return new ConfigReader();
                return instance;
            }
        }


        public ConfigReader()
        {
            Config = new AppSettingConfig();
            Config.AnverseCredentialPath = System.Configuration.ConfigurationManager.AppSettings["AnverseCredentialPath"];
            Config.ReverseCredentialPath = System.Configuration.ConfigurationManager.AppSettings["ReverseCredentialPath"];
            Config.DefaultPicturesFolder = System.Configuration.ConfigurationManager.AppSettings["DefaultPicturesFolder"];
            Config.DefaultOutputFolder = System.Configuration.ConfigurationManager.AppSettings["DefaultOutputFolder"];
            Config.DefaultPrinterName = System.Configuration.ConfigurationManager.AppSettings["DefaultPrinterName"];
        }

        public AppSettingConfig Config { get; private set;}
   

    }
}
